package com.hngy.test.demoproject.controller;

import com.hngy.test.demoproject.entity.pOrder;
import com.hngy.test.demoproject.entity.pUser;
import com.hngy.test.demoproject.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1")
public class UserController {

    @Autowired
    private OrderService orderService;

    @RequestMapping("order/list")
    public List<pOrder> selectAll(){
        List<pOrder> pOrders = orderService.selectOneQue();
        return pOrders;
    }

    @RequestMapping("order/last")
    public List<pOrder> selectLast(){
        List<pOrder> pOrders = orderService.selecyLastOrder();
        return pOrders;
    }
}
